package com.jdd.modules.sdk.ledcall;

import java.util.Date;

import javax.annotation.Resource;

import com.jdd.common.util.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import com.jdd.common.constant.JddConstant;
import com.jdd.common.constant.LedConstant;
import com.jdd.common.util.DateUtils;
import com.jdd.modules.sdk.LedCallInterface;
import com.jdd.modules.sdk.SdkCallInterface;
import com.jdd.modules.sdkidentifyresultpushlog.entity.DiscountCouponDetail;
import com.jdd.modules.sdkidentifyresultpushlog.entity.ParkOrderInfoVO;

/**
 * @author ：jdd孙庆伟
 * @date ：Created in 2021/9/10 17:10
 * @description：菲利德控制板
 * @modified By：`
 * @version: 1.0
 *         //2车牌，3时间，4收费
 */
@Component
@Lazy
public class FeiLiDeLedCallInterface extends LedCallInterface {

    @Resource
    private SdkCallInterface sdkCallInterface;


    /*
     * 无牌车入口显示播报
     *
     * @param serialNo
     * @param plateNo
     * @return void
     * @author jdd孙庆伟
     * @date 2021/9/13 11:26:29
     * @version 1.0
     */
    @Override
    public void EntranceUnlicensed(String serialNo) {
        String str = "无牌车,请与管理员联系";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "无牌车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }


    /**
     * @param serialNo
     * @return
     * @Description 军警车入场播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceSpecial(String serialNo, String plateNo) {
        String str = plateNo + ",欢迎光临";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "军警车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 白名单入场播报
     * @author rensahngyi
     * @Date 2022-02-17
     */
    @Override
    public void EntranceWhite(String serialNo, String plateNo) {
        String str = plateNo + ",欢迎光临";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "贵宾车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:11
     * @Description 白名单过期按照临时车  此方法没启有
     */
    @Override
    public void EntranceParkWhiteOver(String serialNo, String plateNo) {
        String str = plateNo + ",月租车到期,临时车,收费";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:12
     * @Description 月租车过期禁止进入
     */
    @Override
    public void BanMonthOver(String serialNo, String plateNo, Date endTime,String broadcastInfo)  throws Exception {
        String str = StringUtils.isNotBlank(broadcastInfo) ? "月租车,车位已满,禁止入场" :
                "月租车" + plateNo + "已于" + DateUtil.formatDate(endTime, "yyyy-MM-dd") + "过期禁止入场!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止入场", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:13
     * @Description 过期N天不可进入
     */
    @Override
    public void BanMonthOverDay(String serialNo, String plateNo, Date endTimes){
        String str = "月租车," + plateNo + ",已过期,请与管理员联系";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车" + plateNo + "已过期,请与管理员联系", LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止入场", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:14
     * @Description 过期N天内可进入    此方法未启用
     */
    @Override
    public void EnranceMonthOverCan(String serialNo, String plateNo) {
        String str = "月租车," + plateNo + ",已过期";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 月租车过期按照临时车收费播报  此方法未启用
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceMonthlyOverdue(String serialNo, String plateNo){
        String str = "月租车," + plateNo + ",已过期";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 月租车入场播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void MonthlyEntrance(String serialNo, String plateNo,String broadcastInfo){
        // 按月租车入场
//        String str = "月卡车," + plateNo + ",欢迎光临";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, broadcastInfo, LedConstant.feilideFourLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
    }

    @Override
    public void outMonthlyEntrance(String serialNo, String plateNo, String broadcastInfo){
        // 按月租车入场
//        String str = "月卡车," + plateNo + ",欢迎光临";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, broadcastInfo, LedConstant.feilideFourLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
    }

    /**
     * 月租车出场 播报收费信息
     * @param serialNo
     * @param plateNo
     * @param broadcastInfo
     * @return
     * @author renshangyi
     * @date 2022/4/1
     */
    @Override
    public void OutMonthlyShowFee(String serialNo, String plateNo, String broadcastInfo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, broadcastInfo, LedConstant.feilideFourLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
    }

    /**
     * @param serialNo
     * @return
     * @Description 黑名单禁止通行播报
     * @author lcy
     * @Date 2021-08-10
     */
    @Override
    public void EntranceBlacklist(String serialNo, String plateNo) {
        //如果是黑名单并且iFBroadcast为false 则限制入场
        String str = plateNo + "此车为黑名单车辆,禁止通行";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "此车为黑名单车辆", LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止通行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 禁行时间段内播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void JudgeStopDay(String serialNo, String plateNo) {
        String str = "该时段不允许进入";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止通行", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:18
     * @Description 储值车配置自动开闸
     */
    @Override
    public void EntranceStoredInConfig(String serialNo, String plateNo) {
        String str = "储值车," + plateNo + ",欢迎光临";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo,"欢迎光临",LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "储值车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:19
     * @Description 储值车配置手动开闸
     */
    @Override
    public void StoredInConfig(String serialNo, String plateNo) {
        String str = "请等待确认人工放行";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "储值车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideFourLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:19
     * @Description 储值车无配置自动开闸
     */
    @Override
    public void EntranceStoredNoConfig(String serialNo, String plateNo) {
        String str = "储值车," + plateNo + ",欢迎光临";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "储值车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo,  plateNo, LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 临时车入场播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void TemporaryEntrance(String serialNo, String plateNo){
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = "临时车" + plateNo + "欢迎光临!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.feilideFourLineDU );
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:22
     * @Description 临时车入场开闸方式 1 自动开闸
     */
    @Override
    public void TemporaryEntranceInConfig(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        String str = sdkCallInterface.getOverdueType(plateNo)+"临时车," + plateNo + ",欢迎光临!";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "欢迎光临", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.feilideFourLineDU );
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @return void
     * @author lcy
     * @date 2021/8/12 14:22
     * @Description 临时车入场开闸方式 2 确认开闸
     */
    @Override
    public void TemporaryInConfig(String serialNo, String plateNo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请等待确认放行", LedConstant.feilideFourLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "临时车,请等待确认放行");
    }

    /**
     * @param serialNo
     * @return
     * @Description 临时车入场开闸方式 3、不开闸
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void TemporaryBanEntrance(String serialNo,String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo)+"临时车,禁止入场";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止入场", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /**
     * @param serialNo
     * @return
     * @Description 临时车入场车位已满, 禁止通行播报
     * @author shangyue
     * @Date 2021-08-10
     */
    @Override
    public void TemporaryEntranceParkingFull(String serialNo, String plateNo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "车位已满", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止驶入", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心驾驶", LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "安全离场", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, "临时车位已满,禁止通行");
    }

    /**
     * 临时车位已满 确认开闸
     *
     * @param serialNo
     * @param plateNo
     * @return void
     * @author jdd孙庆伟
     * @date 2021/8/31 14:58:26
     * @version 1.0
     */
    @Override
    public void TemporaryEntranceFullConfirmOpened(String serialNo, String plateNo) {
        String str = sdkCallInterface.getOverdueType(plateNo)+"临时车,车位已满,请等待确认放行";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "人工放行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    //---------------------------出场------------------------------

    /**
     * @author lcy
     * @date 2021/8/13
     * @Description 无牌车出场
     */
    @Override
    public void OutUnlicensed(String serialNo) {
        String str = "无牌车,请扫描屏上二维码";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "无牌车", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请扫码", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 特殊车出场
     */
    @Override
    public void OutSpecial(String serialNo, String plateNo) {
        String str = plateNo+",军警车免费通行,祝您一路顺风";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "军警车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "军警车免费通行,祝您一路顺风", LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请通行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 白名单出场
     */
    @Override
    public void OutParkWhite(String serialNo, String plateNo) {
        String str = plateNo+",贵宾车,祝您一路顺风";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "贵宾车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请通行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);

    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 月租车出场 此方法未启用
     */
    @Override
    public void OutMonthly(String serialNo, String plateNo) {
        String str = plateNo+",月租车,祝您一路顺风";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请通行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);

    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 调用计费规则异常处理
     */
    @Override
    public void OutAbnormal(String serialNo, String plateNo) {
        String str = "请与管理员联系";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止出场", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 无异常 无入场记录不抬杆
     */
    @Override
    public void OutAbnormalBan(String serialNo, String plateNo) {
        String str = "无入场记录,请与管理员联系";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止出场", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);

    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 无异常 无入场记录免费放行
     */
    @Override
    public void OutAbnormalCan(String serialNo, String plateNo) {
        String str= "无入场记录,直接放行";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请通行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);

    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 停车费已支付处理
     */
    @Override
    public void OutPayParkingFee(String serialNo, String plateNo) {
        String str =plateNo+",祝您一路顺风";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "请通行", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 使用免费时长券/全免券/小时券的订单
     */
    @Override
    public void OutDiscount(String serialNo, String plateNo, DiscountCouponDetail discountCouponDetail) {
        String str =plateNo+",祝您一路顺风";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "使用" + discountCouponDetail.getCouponName(), LedConstant.feilideFourLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 储值车无入场纪录    此方法未启用
     */
    @Override
    public void OutStoredNoInLogs(String serialNo, String plateNo) {
        String str ="请与管理员联系";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止出场", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 储值车缴费出场
     */
    @Override
    public void OutStoredPayFee(String serialNo, String plateNo, Integer unpayFee, Integer remaining, ParkOrderInfoVO parkOrderInfoVO) {
        //播报用
        String unpayFeeVocice = int2chineseNum(String.valueOf(unpayFee),false);
        String remainingVoice = int2chineseNum(String.valueOf(remaining),false);
        //如果播报0分钟不合适，则更改DateUtils.qianyiTurnDayHourMinuteString的代码，把0分钟改为1分钟
        String strVoice = "储值车," + plateNo + ",停车时长" + DateUtils.qianyiTurnDayHourMinuteString(String.valueOf(parkOrderInfoVO.getChargeDuration()))
                + ",收费" + unpayFeeVocice + "元" + ",剩余金额" + remainingVoice + "元";
        //显示用
        String remainingStr = remaining + ".00";
        String strShow="停车时长" + DateUtils.qianyiTurnDayHourMinuteString(String.valueOf(parkOrderInfoVO.getChargeDuration()));
        String fourLineStr = "收费:" + unpayFee + "元" + ",剩余金额:" + remainingStr + "元";
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "储值车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, fourLineStr, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, strShow, LedConstant.feilideFourLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, strVoice);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 调用计费规则异常处理  此方法未启用
     */
    @Override
    public void OutStoredChargeAbnormal(String serialNo, String plateNo) {
        String str ="请与管理员联系";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "禁止出场", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    /*
     * @author lcy
     * @date 2021/8/13
     * @Description 播报收费信息
     */
    @Override
    public void OutShowFee(String serialNo, String plateNo, ParkOrderInfoVO parkOrderInfo) {
        //播报钱数
        String money = int2chineseNum(parkOrderInfo.getChargeUnpaid(),true);
        //播报文字
        //如果播报0分钟不合适，则更改DateUtils.qianyiTurnDayHourMinuteString的代码，把0分钟改为1分钟
        String voiceStr = parkOrderInfo.getPlateNo() + ",收费" + money + "元" +
                ",停车时长" + DateUtils.qianyiTurnDayHourMinuteString(String.valueOf(parkOrderInfo.getChargeDuration()));
        //4行显示文字
        String chargeStr = "停车费用:" + Integer.parseInt(parkOrderInfo.getChargeUnpaid())/100 + "元";
        //3行显示文字
        String showStr = parkOrderInfo.getPlateNo() + ","+chargeStr +
                ",停车时长" + DateUtils.qianyiTurnDayHourMinuteString(String.valueOf(parkOrderInfo.getChargeDuration()));
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "临时车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, chargeStr, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, showStr, LedConstant.feilideFourLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, voiceStr);
    }


    @Override
    public void RefuseCarEnter(String serialNo, String plateNo) {
        String str="禁止入场,请与管理员联系";
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    @Override
    public void repeatRecognitionConfirmOpened(String serialNo, String plateNo) {
        String str=plateNo + "重复入场";sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心驾驶", LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, str, LedConstant.feilideThreeLineRL);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "重复识别", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, str);
    }

    public void customizedConfirmOpened(String serialNo, String plateNo,String broadcastInfo) {
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "月租车", LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, broadcastInfo, LedConstant.feilideFourLineRL);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, broadcastInfo);
    }

    /*** 功能描述: 菲力德播报钱数有问题，比如190，播报一百九零，需要手动转换一下
     * @Author: lcy
     * @Date: 2021/10/21
     * @param stringMoney 字符串的钱数
     * @param isToChinese 是否需要转换，有的不需要因为单位是元
     */
    public static String int2chineseNum(String stringMoney,boolean isToChinese) {
        if(StringUtils.isBlank(stringMoney)){
            return "";
        }
        //钱数只有十位正常
        if(stringMoney.length()<3){
            return stringMoney;
        }
        Integer src =Integer.parseInt(stringMoney);
        //传来的参数有时单位是元
        if(isToChinese) {
            src =src / 100;
        }
        final String num[] = {"零", "1", "2", "3", "4", "5", "6", "7", "8", "9"};
        final String unit[] = {"", "十", "百", "千", "万", "十", "百", "千", "亿", "十", "百", "千"};
        String dst = "";
        int count = 0;
        while(src > 0) {
            dst = (num[src % 10] + unit[count]) + dst;
            src = src / 10;
            count++;
        }
        return dst.replaceAll("零[千百十]", "零").replaceAll("零+万", "万")
                .replaceAll("零+亿", "亿").replaceAll("亿万", "亿零")
                .replaceAll("零+", "零").replaceAll("零$", "");
    }
    /*** 功能描述: 场内码支付成功得，加上去缴费成功
     * @Author: lcy
     * @Date: 2022/1/19
     */
    @Override
    public void FieldFee(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "缴费成功", LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, plateNo+",缴费成功,一路顺风");
    }

    /**
     * 临时车不收费出场
     * @param serialNo
     * @param plateNo
     */
    @Override
    public void FieldFeeOut(String serialNo, String plateNo) {
        sdkCallInterface.SdkUnfoldAll(JddConstant.SdkOpenGateLog.SWICH_TYPE_ONE, serialNo, plateNo);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "JD停车", LedConstant.feilideOneLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, plateNo, LedConstant.feilideTwoLineDU);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "小心慢行", LedConstant.feilideThreeLineUD);
        sdkCallInterface.Sdk485TestContentCommunicationAll(serialNo, "一路顺风", LedConstant.feilideFourLineDU);
        sdkCallInterface.Sdk485VoiceCommunicationAll(serialNo, plateNo+",一路顺风");
    }
}
